04. Modify List Item Layout

Modify List Item Layout

Question:

Start Quiz:

Solution:

Modify List Item Layout

You may be wondering, why do we refer to the image as @mipmap/ic_launcher (instead of @drawable/ic_launcher).

The app icon is in the res/mipmap folder (instead of the res/drawable folder) because Android handles app icons in a special way. Android wants your app icon to be crisp and clear, regardless of the device, so on some large screen devices, Android use a higher-resolution version of the icon compared to other icons in your app for that device. For more details, check out this article.

You can refer to the image in the same way that you refer to images in the drawable folder, except the resource type is called mipmap. Example:

<ImageView
    android:width=“wrap_content”
    android:height=“wrap_content”
    android:src=“@mipmap/ic_launcher” />